Producers of motion video programs use a variety of special effects to produce a final product. A graphics editor performs the task of adding special effects to motion video segments using a graphics workstation.
Feathering is a special effect that blurs one or more portions of a video image. Feathering often is used when creating a composite video image from a foreground image and a background image. The graphics editor feathers the border between the images thereby blending the images together to create an effect that the two images are truly one image. For example, a composite image including a foreground image of two people walking and a background image of a desert scene, when feathered, provides an appearance of the two people walking in the desert.
The graphics editor generally manipulates a number of images to create a composite image, as illustrated in FIG. 1. Typically, the graphics editor takes a foreground image 24 from a first image 20, and a background image 26 from a second image 28, and combines them using a matte image 32 to form a composite image 38. The matte image is a gray scale image used to generate the composite image 38. In particular, the light area of the matte image indicates that the area 24 of the first image 20 is to be used as the foreground image, and that the area 22 is to be ignored. Similarly, the dark area 36 of the matte image indicates that the area 26 of the second image 28 is to be the used as the background image.
Before generating the composite image 38, the graphics editor modifies the matte image so that the graphics workstation generates a feathering effect between the foreground and background images 24 and 26. In particular, the border area between the light and dark area of the matte image is filtered. If the matte image uses a gray scale that ranges between 0 and 255, the dark area for the background is 0, the light area for the foreground is 255, and the border area between the dark area and light area has values between 0 and 255 depending on the type of filtering applied to the matte image. The degree of realism in the composite image 38 often depends on the type of filtering. When filtering is poor, the viewer may identify a border 36 between the foreground image and the background image so that the effect of interaction between objects in the two images is diminished or lost.
One conventional filter is a box filter which is commonly implemented as a finite impulse response filter (FIR). When a graphics editor filters a matte image through a box filter, the graphics editor identifies a border area in the matte image, and applies the box filter to each pixel of the border area. FIG. 2 illustrates a 3.times.1 box filter function. According to this box filtering function, a presently processed pixel value P.sub.a is set equal to an average of pixel values P.sub.a-1, P.sub.a and P.sub.a+1. Each pixel value is equally weighted as indicated by the fiat slope of the box filtering function.
Filtering may be applied in two dimensions. FIG. 3 illustrates a 3.times.3 box filtering function. Here, the value of the center pixel is set to be the average of the values of the center pixel and the eight surrounding pixels, and the value of each pixel is equally weighted.
Another type of filter is a Gaussian filter which is also commonly implemented as an FIR filter. The Gaussian filter is defined by a Gaussian function, as illustrated in FIG. 4. The Gaussian filter weights each pixel according to its proximity to the pixel being processed, i.e., the center pixel. FIG. 4 shows a 3.times.1 Gaussian filter that weights the pixel P.sub.a by more than the adjacent pixels P.sub.a-1 and P.sub.a+1. A Gaussian filter may be implemented as a two-pass FIR filter: one pass for the horizontal direction, and one pass for the vertical direction.
Producing composite images using such filtering techniques has certain drawbacks. In particular, using a conventional box filtered matte image to create a feathered composite image typically provides unsatisfactory results, i.e., the composite image does not provide a realistic appearance of interaction between objects in the foreground and background images of the composite image. Also, box filtering provides biased results when the width of the filter is defined by an even number of pixels. For example, a typical 4.times.1 box filter processes the present pixel, one pixel to the left of the present pixel, and two pixels to the right of the present pixel.
This unbalanced use of image data effectively shifts the results by half a pixel, and may be noticeable to the viewer. In particular, when playing a sequence of images, portions of the video image may appear to jitter due to box filtering using an even width box filter.
A composite image generated from a Gaussian filtered matte image generally provides suitable results. That is, the composite image provides a realistic appearance that objects in the foreground image are disposed within the background image. However, Gaussian filtering results in a substantial amount of processing time since each pixel value is multiplied by a weighted coefficient. For example, a 32.times.32 Gaussian filter operating on a 132 MHZ Power PC available from Apple Computer of Cupertino, California, requires approximately 1.5 minutes to filter completely a typical matte image having a dimension of 720.times.486 pixels. Accordingly, Gaussian filtering is impractical for feathering image sequences of 100 images or even 1000 images as often desired in the movie and television industries. Furthermore, as the width of the Gaussian filter increases, processing time increases. In particular, each pixel increase in the width of a Gaussian filter adds one multiply operation per pass and one add operation per pass for each pixel to be processed.
Using a matte image that has been filtered as described above also results in a composite image which has equal amounts of feathering into the foreground image and feathering out into the background image. However, in some cases, such a result creates artifacts in the image that are unacceptable. For example, if a picture of a yellow ball is being combined with an image of a grey sky background, feathering in of the grey sky into the yellow ball may produce undesirable results, such as a halo image around the ball (a halo effect is shown in image 38, FIG. 1).
One way to avoid such an undesirable result is by changing an outline which circumscribes a processing area of the image and reprocessing the image which results in numerous additional calculations. In addition, if the outline does not carefully circumscribe the processing area, the resulting image may not be accurate. For example, the resulting image may include overlapping portions or pinched comers.